Use scoped contribution hints with Metro 1.2.0#72
Draft
tcmulcahy wants to merge 6 commits into
Draft
Conversation
196c698 to
66916b0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(TODO: rewrite the following AI slop)
Summary
@ContributesMultibindingScopedbinding containers throughMetroContributionExtension.Contribution.ContributesMultibindingScopedFir.getContributionHints()path for discovery of the generated binding containers.Context
Metro 1.2.0 includes an upstream behavior change: generated binding containers from contributed binding declarations are no longer merged as graph supertypes.
@ContributesMultibindingScopedwas relying on that older behavior by returning generated binding containers fromContributesMultibindingScopedMetroExtension.getContributions().The release notes do not call out contribution hints specifically. The hint part is from Metro's existing FIR extension API and this project already had the required hints in
ContributesMultibindingScopedFir.getContributionHints(). With Metro 1.2.0, the old synthetic contribution/supertype bridge is no longer valid, so this removes that duplicate path and leaves discovery to the existing hint path.Tests
JAVA_HOME=$(/usr/libexec/java_home -v 25) ./gradlew :compiler:test --tests 'com.squareup.metro.extensions.runners.BoxTestGenerated$Contributesfeatureflag' --tests 'com.squareup.metro.extensions.runners.BoxTestGenerated$Contributesrobot' --tests 'com.squareup.metro.extensions.runners.BoxTestGenerated$Contributesservice' --tests 'com.squareup.metro.extensions.runners.BoxTestGenerated$Developmentappcomponent' --tests 'com.squareup.metro.extensions.runners.BoxTestGenerated$Contributesmultibindingscoped' --rerun-tasks --quietJAVA_HOME=$(/usr/libexec/java_home -v 25) ./gradlew :compiler:apiCheck --quiet